<script setup lang="ts">
import * as echarts from 'echarts'
// 水球图扩展插件
import 'echarts-liquidfill'
const charts = ref()
onMounted(() => {
  let myecharts = echarts.init(charts.value)
  // 设置echarts配置项
  myecharts.setOption({
    // 标题组件
    title: {
      // text: '水球图'
    },
    // x|y轴组件
    // xAxis: {},
    // yAxis: {},
    // 数据系列
    series: {
      type: 'liquidFill',
      data: [0.83, 0.3], // 2个波纹数
      radius: '90%' // 水球大小
    },
    // 位置布局
    grid: {
      left: 10,
      right: 10,
      top: 30,
      bottom: 10
    }
  })
})
let people = ref('415908人')
</script>

<template>
  <div class="box1">
    <div class="top">
      <p class="title">当年患者总人次</p>
      <p class="bg"></p>
      <p class="right">可预约总量<span>825</span>人</p>
    </div>
    <div class="number">
      <span v-for="(item, index) in people" :key="index">{{ item }}</span>
    </div>
    <div class="charts" ref="charts"></div>
  </div>
</template>

<style lang="scss" scoped>
.box1 {
  background: url(../images/dataScreen-main-lb.png) no-repeat;
  background-size: 100% 100%;
  margin-top: 10px;
  .top {
    margin: 10px 0 0 20px;
    .title {
      color: white;
      font-size: 20px;
    }
    .bg {
      width: 100px;
      height: 7px;
      background: url(../images/dataScreen-title.png) no-repeat;
      background-size: 100% 100%;
      margin-top: 20px;
    }
    .right {
      float: right;
      color: white;
      font-size: 20px;
      span {
        color: yellowgreen;
      }
    }
  }
  .number {
    margin: 35px 10px 10px 10px;
    display: flex;
    span {
      flex: 1;
      height: 50px;
      text-align: center;
      line-height: 50px;
      color: #29fcff;
      font-size: 30px;
      background: url(../images/total.png) no-repeat;
      background-size: 100% 100%;
    }
  }
  .charts {
    width: 100%;
    height: 280px;
  }
}
</style>
